Descriptor Records
Descriptor Records
Applications must use Apple Event Manager functions to create and send an
Apple event. The Apple Event Manager constructs its own internal data
structures to contain the information in an Apple event. To gain access to this
data, the target application also must use Apple Event Manager functions.
Neither the sender nor the receiver of an Apple event can directly manipulate
the data inside an Apple event; each must rely on Apple Event Manager
functions to do so. This section describes the data structures that the
Apple Event Manager uses to create and to process Apple events.
Descriptor records are the fundamental structures from which Apple events
are constructed. A descriptor record is a data structure of type AEDesc; it
consists of a handle to data and a descriptor type that identifies the type of the
data referred to by the handle.
The data referred to by the dataHandle field in the descriptor record is private
to the Apple Event Manager. You can supply or extract this data only by
using Apple Event Manager routines.
The following figure illustrates a descriptor record with a descriptor type of
typeType, which specifies that the data in the descriptor record must consist
of a four-character code. The data in this particular descriptor record is
specified by the constant kCoreEventClass, whose value is 'aevt'.
A descriptor record with event class data
A descriptor record that contains the address of the target or source of an
Apple event is called an address descriptor record
As you will see later, the address can be specified as an application signature,
a process serial number, a session ID, a target ID record, or a data type that
you define.
Data for attributes and parameters is contained in descriptor records. The
attributes and parameters themselves are identified by keywords. The
AEKeyword data type is defined as a four-character code.
Constants are typically used for keywords. For a list of these keyword
constants, their four-character codes, and the attributes and parameters they
represent see Apple Event Manager Data.
A data structure of type AEKeyDesc consists of a keyword and a descriptor
record. This data structure, called a keyword-specified descriptor record, is
used by the Apple Event Manager to fully identify and describe an attribute
or a parameter of an Apple event.
The following figure illustrates a keyword-specified descriptor record for
the event class attribute of an Open Documents event. The keyEventClassAttr
keyword identifies its descriptor record as containing event class data. The data
is of the typeType descriptor type, and the data identifies the event class as
kCoreEventClass.
A keyword-specified descriptor record for the event class attribute of an
Open Documents event.